#ifndef _RINGLIB_H_
#define _RINGLIB_H_

typedef struct {
    char * p_buf;
    size_t size;
    char * p_start;
    char * p_end;
} ring;

int ring_is_full(ring * rng);

int ring_is_empty(ring * rng);

size_t ring_free_size(ring * rng);

ring * ring_empty(ring * rng);

size_t ring_data_size(ring * rng);

size_t ring_data_put(ring * rng, char * bfr, size_t n);

size_t ring_data_get(ring * rng, char * bfr, size_t n);

#endif _RINGLIB_H_ /* end of _RINGLIB_H_ */
